function bindElements(){

	//type-ahead
    $("#UserSearch").click(function(){
        this.value = '';
    });    
    
    //type-ahead
    $("#UserSearch").autocomplete({
        source: function(request, response){
            $("#UserProgress").show();
            $.ajax({
                type:'GET',url: $("#AjaxController").val() + "?api=UserSearch&userSearchString=" + request.term,
                dataType: "json",
                success: function( json ) {
                    $("#UserProgress").hide();
                    response( $.map( json.DATA, function( n ) {//this is a auto returned variable.  jquery kungfu
                        return {value: n[6], id: n[0], url: n[1] }
                    }));
                }
            });
        },
        minLength: 3,
        delay: 0,
        select: function(event, ui){
            console.debug(event, ui);            
        }
    });
}


function submitProcessor(){              
    var EmployeeObj = {EmployeeUserAccount: $("#UserAccount option:selected").val()};
    var FormAction = $("#FormAction").val();            
    $.ajax({
        type:'POST', url: FormAction, dataType: 'json', async: false, data: EmployeeObj,
        success: function(json) { jsonData = json; },
        complete: function(){ location.href = '../status.cfm'; },
        error: function(){ return false; }
    });   
};

$(function(){
	bindElements();
});